<template>
  <div id="app">
    <!--<router-div/>-->
    <v-ons-navigator swipeable swipe-target-width="200px"
                     :page-stack="pageStack"
                     :pop-page="goBack"
    ></v-ons-navigator>
  </div>
</template>

<script>
  export default {
    name: 'App',
    data() {
      return {
        pageStack: []
      }
    },

    methods: {
      goBack() {
        this.$router.push({name: this.$route.matched[this.$route.matched.length - 2].name});
      }
    },

    created() {
      const mapRouteStack = route => this.pageStack = route.matched.map(m => m.components.default);
      mapRouteStack(this.$route);
      this.$router.beforeEach((to, from, next) => mapRouteStack(to) && next());
    }
  }
</script>

<style>
  #app {
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    margin-top: 60px;
  }
  *{
    outline: none;
  }
  ul, li {
    margin: 0;
    padding: 0;
    list-style-type: none !important;
  }

  /* vnis number-input-spinner */
  .back-button__label{
    font-size: 14px !important;
  }
  .vnis__button {
    background: #505050 !important;
  }
  .toolbar__title{
    font-size: 14px;
  }
  :checked + .tabbar__button{
    color: #20AD20 !important;
  }
  .tabbar__icon{
    font-size: 20px;
  }

</style>
